package com.zzl.car.mapper;

import com.zzl.car.entity.CarOrder;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

public interface CarOrderMapper {


    /*
    * 查询所有订单
    * */
    public List<CarOrder> getAllOrder();

    /*
    * 查询用户的所有订单
    * */
    public List<CarOrder> getAllOrderByUser(String telephone);

    /*
    * 查询用户指定状态的订单
    * */
    public List<CarOrder> getAllOrderByUserAndState(@Param("telephone")String telephone, @Param("state")Integer state);

    /*
    * 根据订单号查询订单
    * */
    public CarOrder getOrderByOrderNumber(String orderNumber);

    /*
    * 生成订单，
    * */
    public Integer createNewCarOrder(CarOrder carOrder);

    /*
    * 生成订单，不带保障服务的
    * */
    public CarOrder createNewCarOrderNoInsurance(CarOrder carOrder);

    /*
    * 获取订单中最大id
    * */
    public Integer getCarOrderMaxId();

    /*
    * 查询订单,在一星期内的订单
    * */
    public List<CarOrder> getCarOrderInWeek(@Param("time") Timestamp time,
                                            @Param("state") int state);

    /*
    * 更新订单信息
    * */
    public Integer updateCarOrder(CarOrder order);

}
